#pragma once

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include "Thread.hpp"
#include "lockguard.hpp"
#include "log.hpp"

const int thread_num=4;

template<typename T>
class ThreadPool
{
private:
    std::vector<Thread*> threads_;
    std::queue<T> task_queue_;
    int num_;
    pthread_mutex_t mtx_;
    pthread_cond_t cond_;

public:
    ThreadPool(int t_num = thread_num)
        :num_(t_num)
    {
        pthread_mutex_init(&mtx_, NULL);
        pthread_cond_init(&cond_, NULL);
        for(int i=1;i<=num_;++i)
        {
            threads_.push_back(new Thread(i,&ThreadPool::routine,this));
        }
    }

    static void* routine(void *args)
    {
        
    }
};